import Vue from 'vue'
// import './axios'
import {
  NAVIGATION_BAR_URL,
  HOME_BANNER_URL,
  HOME_BASE_URL,
  CATEGORY_BASE,
  FETCH_GOODS_DETAIL,
  PROVINCE_ALL,
  DELIVERY_IN_CITY,
  API_COMMENT_LIST,
  API_COMMON_QUESTION
} from './config'

export const fetchNavigationBar = (params) => Vue.axios.get(NAVIGATION_BAR_URL)
export const fetchHomeBanner = (params) => Vue.axios.post(HOME_BANNER_URL)
export const fetchHomeBase = (params) => Vue.axios.post(HOME_BASE_URL)
export const fetchCategory = (params) => Vue.axios.post(CATEGORY_BASE)
export const fetchGoodsDetail = (params) => Vue.axios.post(`${FETCH_GOODS_DETAIL}/${params}`)
export const fetchProvince = () => Vue.axios.post(`${PROVINCE_ALL}`)
export const fetchDelivery = params => Vue.axios.post(`${DELIVERY_IN_CITY}`, params)
export const fetchCommentList = params => Vue.axios.post(`${API_COMMENT_LIST}`, params)
export const fetchCommonQuestion = () => Vue.axios.post(`${API_COMMON_QUESTION}`)
